﻿using System;
using System.Collections.Generic;
using System.Linq;
using InvestmentIntelligence.DbModel.Models;

namespace InvestmentIntelligence.Data.Repository
{
    public interface ISettingsRepository
    {
        /// <summary>
        ///     Get settings
        /// </summary>
        /// <param name="userId">owner id</param>
        /// <param name="typeName">settings type full name</param>
        /// <returns>Settings for user by typeName</returns>
        T Get<T>(Func<IQueryable<Parameter>, T> f, int userId, string typeName);

        /// <summary>
        ///     Get settings
        /// </summary>
        /// <param name="typeName">settings type full name</param>
        /// <returns>Settings by typeName</returns>
        T Get<T>(Func<IQueryable<Parameter>, T> f, string typeName);

        T Get<T>(Func<IQueryable<Parameter>, T> f);

        /// <summary>
        ///     Add new settings entity
        /// </summary>
        /// <param name="item">item to add</param>
        void Add(Parameter item);        

        void Update(Parameter item);
    }
}